package com.xsmart.goods.init;

import com.xsmart.common.init.ServicesDiscoveryImpl;
import com.xsmart.common.util.RedisUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Component;

/**
 * 服务发现
 */
@Component
public class ServicesDiscoveryInit {
    @Value("${spring.application.name}")
    protected String applicationName;
    @Autowired
    private RedisUtil redisUtil;
    @Autowired
    ApplicationContext applicationContext;

    public void initServicesDiscovery() {
        ServicesDiscoveryImpl servicesDiscoveryImpl = new ServicesDiscoveryImpl();
        servicesDiscoveryImpl.initServicesDiscovery(applicationName, redisUtil, applicationContext);
    }
}
